package com.example.emos.wx.exception;
import lombok.Data;
/**
 * @program: emos-wx-api
 * @author: JackLiang
 * @create: 2021-03-26 10:13
 **/


/*
* 自定义异常类
* 继承RunTimeException可以让虚拟机自动处理一些异常，不用手动处理
* */

@Data
public class EmosException extends RuntimeException{
    private String msg;
    private int code = 500;

    public EmosException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public EmosException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public EmosException(String msg, int code) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public EmosException(String msg, int code, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }
}
